package com.nhpman.pattern.interpreter1;

public class DirectionNode extends AbstractNode {
	private String direction;
	
	public DirectionNode(String direction){
		this.direction = direction;
	}
	
	public String interpret(){
		if(direction.equalsIgnoreCase("up")){
			return "up";
		}else if(direction.equalsIgnoreCase("down")){
			return "down";
		}else if(direction.equalsIgnoreCase("left")){
			return "left";
		}else if(direction.equalsIgnoreCase("right")){
			return "right";
		}else{
			return "error command";
		}
	}
}
